﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LoungeRepo.Core;

namespace MappingPartitions
{
    class Program
    {
        static void Main(string[] args)
        {
            using(var repo = new LoungeRepository())
            {
                repo.RegisterPartitionEntityStore("a*", "Starting_with_A");
                    // use an absolute partition path if you like
                repo.RegisterPartitionEntityStore("*z", "Ending_with_Z");

                repo.Store("store in A", "1", "abc");
                repo.Store("store in Z", "1", "xyz");
                repo.Store("also store in Z", "1", "12z");
                repo.Store("store in default", "1", "");
            }

            using (var repo = new LoungeRepository())
            {
                repo.RegisterPartitionEntityStore("a*", "Starting_with_A");
                repo.RegisterPartitionEntityStore("*z", "Ending_with_Z");

                Console.WriteLine(repo.Load("1", "abc"));
                Console.WriteLine(repo.Load("1", "xyz"));
                Console.WriteLine(repo.Load("1", "12z"));
                Console.WriteLine(repo.Load("1", ""));
            }
        }
    }
}
